//**********************************************************************
//  Book.java   Author: Tang Caiming
//
//  Write a Book class, in fact, the data represents the title, author,
//  publisher, and copyright date.Define a Book construct method to
//  receive and initialize instance data;Define the methods for
//  obtaining and setting them for all instance data definitions;Define
//  a toString method that returns a string that describes the book.
//  Create a Bookshelf drive class whose main method instantiates and
//  returns some Book objects. 
//**********************************************************************

public class Book
{
   private String bookname;  // 书名
   private String author;  // 作者
   private String press;  // 出版社
   private String copyrightdate; // 日期
   public Book(){} 
   public Book(String name, String au, String pr, String cda)
   {
      bookname = name;
      author = au;
      press = pr;
      copyrightdate = cda;
   }

   public void setBookname(String name)
   {
      bookname = name;
   }
  
   public String getBookname()
   {
      return bookname;
   }

   public void setAuthor(String au)
   {
      author = au;
   }

   public String getAuthor()
   {
      return author;
   }
  
   public void setPress(String pr)
   {
      press = pr;
   }

   public String getPress()
   {
      return press;
   }

   public void setCopyrightdate(String cda)
   {
      copyrightdate = cda;
   }

   public String getCopyrightdate()
   {
      return copyrightdate;
   }

   public String toString()
   {
     
      return "书名" + bookname + "\n作者" + author + "\n出版社" + press + "\n出版日期" + copyrightdate;
   }
}
